﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    /// <summary>
    /// 数据列
    /// </summary>
    [Serializable]
    public class DataObjectRelation : System.ICloneable
    {
        /// <summary>
        /// ID
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 源DO id
        /// </summary>
        public string FromDoID { get; set; }

        /// <summary>
        /// 源DO 列id
        /// </summary>
        public string FromColumnID { get; set; }

        /// <summary>
        /// 目标DO id
        /// </summary>
        public string ToDoID { get; set; }

        /// <summary>
        /// 目标DO 列id
        /// </summary>
        public string ToColumnID { get; set; }

        /// <summary>
        /// 关联关系类型：0: 1…N; 1: 1…1
        /// </summary>
        public int RelationType { get; set; }

        /// <summary>
        /// 删除规则:0:ignore; 1:delete; 2:protected
        /// </summary>
        public int DeleteRule { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext1 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext2 { get; set; }

        /// <summary>
        /// 备用字段
        /// </summary>
        [JsonIgnore]
        public string Ext3 { get; set; }
        /// <summary>
        /// 创建人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
